home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagn_r.zip / RECORDS.SWG / 0013_Getting Record Offsets.pas < prev   
Pascal/Delphi Source File  |  1995-03-03  |  298b  |  21 lines

  1. {
  2. > Does anyone know how I can find and use the offset of
  3. > a given field in a record?
  4.  
  5. AFAIK, you can only use BASM for that. example:
  6. }
  7.  
  8. type
  9.  XXX=record
  10.   A,B,C:byte;
  11.  end;
  12. var
  13.  W:word;
  14. begin
  15.  asm
  16.   mov ax,XXX.A
  17.   mov W,ax
  18.  end;
  19.  { W holds now the offset of A in XXX }
  20. end.
  21.